package org.raymond.iworks.study.basic.designpattern.memento.game;

/**
 * @author raymond
 * @version V1.0
 * @Description: TODO
 */
public class Client {
    public static void main(String[] args) {
        GameRole gameRole = new GameRole();
        gameRole.setVit(100);
        gameRole.setDef(100);

        System.out.println("boss战之前的状态");
        gameRole.display();

        Caretaker caretaker = new Caretaker();
        caretaker.setMemento(gameRole.createMemento());

        System.out.println("开始boss战");
        gameRole.setVit(30);
        gameRole.setDef(30);
        gameRole.display();

        System.out.println("boss战后用memento恢复");
        gameRole.recoverGameRole(caretaker.getMemento());

        System.out.println("恢复后的状态");
        gameRole.display();
    }
}
